import { UP_DOWN_SHELVES_OPTIONS, IMAGE_TEXT_STATE_OPTIONS } from '@/constants/commodity';
import { getUserInfoListService, getDepartmentsService } from '@/api/usercenter';
import { queryFinalCategoryService, getAllBrandListService } from '@/api/commodity/common';
export const FORM_ITEMS = [
  {
    prop: 'customerId',
    label: '关联客户',
    type: 'slot',
    slotName: 'selectCustomer'
  },
  {
    prop: 'categoryUuid', // 联想搜索，传id
    label: '四级类名称',
    type: 'select',
    remote: true,
    remoteMethod: queryFinalCategoryService,
    paramKey: 'key',
    optionKeys: { valueKey: 'categoryUuid', labelKey: 'categoryName' }
  },
  {
    prop: 'skuNo',
    label: 'SKU编码',
    type: 'input'
  },
  {
    prop: 'brandUuid', // 联想搜索，传id
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: getAllBrandListService,
    paramKey: 'brandName',
    optionKeys: { valueKey: 'brandUuid', labelKey: 'brandName' },
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'createOper', // 联想搜索，传id
    label: '创建人',
    type: 'select',
    remote: true,
    remoteMethod: getUserInfoListService,
    paramKey: 'userName',
    optionKeys: { valueKey: 'userIdStr', labelKey: 'userName', codeKey: 'jobNumber' }
  },
  {
    prop: 'orgId', // 联想搜索，传id
    label: '创建人部门',
    type: 'select',
    remote: true,
    remoteMethod: getDepartmentsService,
    paramKey: 'departmentName',
    optionKeys: { valueKey: 'departmentId', labelKey: 'departmentName', codeKey: 'companyName' }
  },
  {
    prop: 'createTime',
    label: '创建时间',
    type: 'datePicker',
    datePickerType: 'daterange',
    valueFormat: 'yyyy-MM-dd'
  },
  {
    prop: 'offTime',
    label: '预计下架时间',
    type: 'datePicker',
    datePickerType: 'daterange',
    valueFormat: 'yyyy-MM-dd'
  },
  {
    prop: 'skuState',
    label: '上下架状态',
    type: 'select',
    options: UP_DOWN_SHELVES_OPTIONS,
    defaultVal: '1'
  },
  {
    prop: 'imageStatus',
    label: '图文完善状态',
    type: 'select',
    clearable: true,
    options: IMAGE_TEXT_STATE_OPTIONS
  }
];

export const TABLE_COLUMNS = [
  {
    title: '关联客户',
    key: 'customerName',
  },
  {
    title: '上下架状态',
    key: 'skuStateStr'
  },
  {
    title: '转临采状态',
    key: 'transCollectStatusStr'
  },
  {
    title: '四级类代码',
    key: 'categoryNo'
  },
  {
    title: '四级类名称',
    key: 'categoryName'
  },
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '品牌',
    key: 'brandName'
  },
  {
    title: '其他品牌',
    key: 'otherBrand'
  },
  {
    title: '商品名称',
    key: 'productName'
  },
  {
    title: '规格',
    key: 'specDetail'
  },
  {
    title: '计量单位',
    key: 'unitName'
  },
  {
    title: '成本价',
    key: 'costPriceStr'
  },
  {
    title: '售价',
    key: 'sellPriceStr'
  },
  {
    title: '创建人',
    key: 'createOperName'
  },
  {
    title: '创建时间',
    key: 'createOpeTime'
  },
  {
    title: '创建人部门',
    key: 'orgName'
  },
  {
    title: '预计下架时间',
    key: 'expectOffTime'
  },
  {
    title: '图文完善状态',
    key: 'imageStatusStr'
  },
  {
    title: '图文完善人',
    key: 'imageSubmitOperName'
  },
  {
    title: '图文完善时间',
    key: 'imageSubmitOperTime'
  }
];

export const LOG_TABLE_COLUMNS = [
  {
    title: '创建人名称',
    key: 'createOperName'
  },
  {
    title: '创建时间',
    key: 'createOpeTime'
  },
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '内容',
    key: 'content'
  }
]

export const CacheKey = 'translate-temporary-goods-uuids';
